/**
 * @summary 模糊搜索模块
 * @author  ll
 */

import * as searchAPI from '@/api/fuzzyearch';

export default {
  namespaced: true,
  state: {
  // 频道列表
    fuzzySearchList: [],
    searchList: [],
  },
  mutations: {
    SET_FUZZY_SEARCH_LIST(state, newValue) {
      state.fuzzySearchList = newValue;
    },
    SET_SEARCH_LIST(state, newValue) {
      state.searchList = newValue;
    }
  },
  actions: {
    async updateFuzzySearchList(context, v) {
      const res = await searchAPI.getFuzzySearchList(v);
      context.commit('SET_FUZZY_SEARCH_LIST', res);
    },
    async updateSearchList(context, v) {
      const res = await searchAPI.getSearchList(v);
      context.commit('SET_SEARCH_LIST', res);
    },

  }
}
